package com.example.springbootclass8.stbu;

import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/user")
public class UserController {

    @GetMapping("/{id}")
    public UserBean getUserById(@PathVariable int id) {
        UserBean userBean = new UserBean();
        userBean.setUid(id);
        userBean.setName("testA");
        userBean.setAge(20);
        userBean.setSex("女");
        return userBean;
    }

    @PutMapping("")
    public UserBean addUser(@RequestBody UserBean userBean) {
        return userBean;
    }
}
